﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace doufu.Model
{
    [PetaPoco.TableName("users")]
    [PetaPoco.PrimaryKey("user_id")]
    public class users : ModelBase
    {
        public int user_id { get; set; }

        [DisplayName("用户名")]
        [Required(ErrorMessage = "用户名不能为空")]
        public string user_name { get; set; }

        [DisplayName("密码")]
        [Required]
        [DataType(DataType.Password)]
        public string password { get; set; }

        [DisplayName("记住我?")]
        [PetaPoco.Ignore]
        public bool RememberMe { get; set; }
        [Display(Name = "姓名")]
        public string fullname { get; set; }
        [Display(Name = "状态")]
        public int user_status { get; set; }
        [DisplayName("邮箱")]
        public string email { get; set; }
        public string last_login_ip { get; set; }
        public DateTime last_login { get; set; }

        /// <summary>
        /// 0 注册，1 QQ
        /// </summary>
        [DisplayName("认证类型")]
        public int openType { get; set; }

        [DisplayName("openId")]
        public string openId { get; set; }
        [DisplayName("accessToken")]
        public string accessToken { get; set; }

        public int gender { get; set; }

        [PetaPoco.Ignore]
        public List<permission> Permission { get; set; }
    }
}